package sma.infos;

import java.util.Vector;

public class InfoCV {
	private InfoPersonnelles ipEmploye;
	
	private float fAnneeExperiences;
	
	//1 : Informatique
	//2 : Construction
	//3 : Communication
	//4 : Services Financiers
	//5 : Tourisme ou Hotel
	//6 : Production
	private int iBranche;
	
	private String sNomBranche;
	
	private String sLieuTravail;
	
	private float fSalaireSouhaite;
	
	private Vector<String> aLanguagesEtrangeres;
	
	public InfoCV (InfoPersonnelles ip){
		this.ipEmploye = new InfoPersonnelles();
		this.ipEmploye.setNom(ip.getNom());
		this.ipEmploye.setPreNom(ip.getPreNom());
		this.ipEmploye.setDateNaissance(ip.getDateNaissance());
		this.ipEmploye.setLieuNaissance(ip.getLieuNaissance());
		this.ipEmploye.setAge(ip.getAge());
		this.ipEmploye.setEcoleLycenciePlusRecent(ip.getEcoleLycenciePlusRecent());
		this.ipEmploye.setAnneeLycencieePlusRecent(ip.getAnneeLycencieePlusRecent());
		this.ipEmploye.setSexuel(ip.getSexuel());
		this.ipEmploye.setNiveauEtude(ip.getNiveauEtude());
	}
	
	public InfoCV(){
		
	}
	
	public InfoPersonnelles getInfoPersonnelles(){
		return this.ipEmploye;
	}
	
	public void setAnneeExperiences(float anneeExperience){
		this.fAnneeExperiences = anneeExperience;
	}
	
	public float getAnneeExperiences(){
		return this.fAnneeExperiences;
	}
	
	public void setBranche(int branche){
		this.iBranche = branche;
	}
	
	public int getBranche(){
		return this.iBranche;
	}
	
	public void setNomBranche(){
		switch(this.iBranche){
		case 0:
			this.sNomBranche = "Informatique";
			break;
		case 1:
			this.sNomBranche = "Construction";
			break;
		case 2:
			this.sNomBranche = "Communication";
			break;
		case 3:
			this.sNomBranche = "Services Financiers";
			break;
		case 4:
			this.sNomBranche = "Tourisme ou Hotel";
			break;
		case 5:
			this.sNomBranche = "Production";
			break;
		default:
			this.sNomBranche = "None";
			break;
		}
	}
	
	public String getNomBranche(){
		return this.sNomBranche;
	}
	
	public void setLieuTravail(String lieu){
		this.sLieuTravail = lieu;
	}
	
	public String getLieuTravail(){
		return this.sLieuTravail;
	}
	
	public void setSalaireSouhaite(float salaire){
		this.fSalaireSouhaite = salaire;
	}
	
	public float getSalaireSouhaite(){
		return this.fSalaireSouhaite;
	}
	
	public void setLanguagesEtrangeres (Vector<String> le){
		this.aLanguagesEtrangeres = new Vector<String> (le.size());
		for (int i = 0; i < le.size(); i++){
			this.aLanguagesEtrangeres.addElement(le.elementAt(i));
		}
	}
	
	public Vector<String> getLanguagesEtrangeres(){
		return this.aLanguagesEtrangeres;
	}
	
	public void displayInfoVC(){
		System.out.println("##### Info. CV #####");
		this.ipEmploye.displayInfoPersonnelles();
		System.out.println("### Info. travail ###");
		System.out.println("Domaine de travail : " + this.getBranche() + "-" + this.getNomBranche());
		System.out.println("Lieu de travail : " + this.getLieuTravail());
		System.out.println("Annee d'experiences : " + this.getAnneeExperiences());
		System.out.println("Langages etrangeres : ");
		for (int i = 0; i < this.aLanguagesEtrangeres.size(); i++){
			System.out.print(this.aLanguagesEtrangeres.get(i) + "; ");
		}
		System.out.println("\nSalaire souhaite : " + this.getSalaireSouhaite());
	}
}